<?php

if(!empty($_GET['username_flag']))
{
//	echo 666;
//	die;
	$re = selectone('admin',"username='".$_GET['username']."'");

	if(empty($re))
	{
		echo 12000;
	}else
	{
		echo 12001;
	}
	die;
}



if(!empty($_GET['nickname_flag']))
{
//	echo 666;
//	die;
	$re = selectone('admin','nickname="'.$_GET['nickname'].'"');

	if(empty($re))
	{
		echo 12000;
	}else
	{
		echo 12001;
	}
	die;
}

if(!empty($_POST))
{
	unset($_POST['psd_confirm']);
	$_POST['date'] = time();
	$_POST['password'] = md5($_POST['password']);
	$re = insert('admin', $_POST);
	if($re)
	{
		echo '10086';
		die;
	}
	else
	{
		echo '10087';
		die;
	}	
}

$role = selectAll('permission');

include('app/admin/maneger/html/add.html');
?>